'use strict';

/**
 * API MAP 对象
 * 页面上所有ajax请求统一在这里管理.
 */
var home = (window.location.host.indexOf("127.0.0.1:8000")>-1)?"http://localhost":"";
export default {
  //本地开发环境,一般可以mock数据
  local : {
    /*invoke*/
    /*home : "/data/home.json",*/
    getTmcState : home+"/index.php/QnuiRings/QnuiTmc/state",
    getTopics : home+"/index.php/QnuiRings/QnuiTmc/topics",
    permitTopics : home+"/index.php/QnuiRings/QnuiTmc/permit",
    cancelTmcUser : home+"/index.php/QnuiRings/QnuiTmc/cancle",
    getStatus : home+"/index.php/QnuiRings/QnuiTmc/get_state",
	/*通用限时打折*/
    createShopActive:home+"/index.php/QnuiRings/QnuiZhekou/create_shop_active",
    saveShopActiveToDatabase:home+"/index.php/QnuiRings/QnuiZhekouSave/save_active_to_database",
    removeShopActiveFromDatabase:home+"/index.php/QnuiRings/QnuiZhekouSave/remove_active_from_database",
    addItemsToActive:home+"/index.php/QnuiRings/QnuiZhekou/add_items_to_active",
    editItemInActive:home+"/index.php/QnuiRings/QnuiZhekou/edit_item_in_active",
    getItemsInActive:home+"/index.php/QnuiRings/QnuiZhekou/get_items_in_active",
    removeItemsInActive:home+"/index.php/QnuiRings/QnuiZhekou/remove_items_in_active",
    getItemsOnSale:home+"/index.php/QnuiRings/QnuiZhekou/items_on_sale",
    getItemsIndepot:home+"/index.php/QnuiRings/QnuiZhekou/items_in_depot",
    getSellerCats:home+"/index.php/QnuiRings/QnuiZhekou/sellercats_list",
    getItemsByIds:home+"/index.php/QnuiRings/QnuiZhekou/items_by_ids",
    getActiveList:home+"/index.php/QnuiRings/QnuiZhekou/get_active_list",
    getActiveListInDatabase:home+"/index.php/QnuiRings/QnuiZhekouSave/get_active_list",
    editActive:home+"/index.php/QnuiRings/QnuiZhekou/edit_active",
    editActiveInDatabase:home+"/index.php/QnuiRings/QnuiZhekouSave/edit_active",
    removeActive:home+"/index.php/QnuiRings/QnuiZhekou/remove_active",
    getShopActiveList:home+"/index.php/QnuiRings/QnuiZhekou/get_shop_active_list",
    getShopActiveDetail:home+"/index.php/QnuiRings/QnuiZhekou/get_shop_active_detail",
    editShopActive:home+"/index.php/QnuiRings/QnuiZhekou/edit_shop_active",
    removeShopActive:home+"/index.php/QnuiRings/QnuiZhekou/remove_shop_active",
	/*通用限时打折*/
	
    /* 满就送打折 */
    createMjs:home+"/index.php/QnuiRings/QnuiMjs/create_mjs",
    updateMjs:home+"/index.php/QnuiRings/QnuiMjs/update_mjs",
    removeMjs:home+"/index.php/QnuiRings/QnuiMjs/remove_mjs",
   saveMjsToDatabase:home+"/index.php/QnuiRings/QnuiMjsSave/save_mjs",
   addItemsToMjsActive:home+"/index.php/QnuiRings/QnuiMjs/add_items_to_active",
   saveMjsItemsToDatabase:home+"/index.php/QnuiRings/QnuiMjsSave/save_items",
   getMjsList:home+"/index.php/QnuiRings/QnuiMjsSave/get_mjs_list",
   getMjs:home+"/index.php/QnuiRings/QnuiMjsSave/get_mjs",
   removeMjsFromDatabase:home+"/index.php/QnuiRings/QnuiMjsSave/remove_mjs",
   
   	/*限购打折*/
   saveLimitToDatabase:home+"/index.php/QnuiRings/QnuiZhekouLimitSave/save_limit",
   saveLimitItemToDatabase:home+"/index.php/QnuiRings/QnuiZhekouLimitSave/save_items_to_database",
   getLimitListInDatabase:home+"/index.php/QnuiRings/QnuiZhekouLimitSave/get_list",
   removeLimitFromDatabase:home+"/index.php/QnuiRings/QnuiZhekouLimitSave/remove",
   getItemsInLimitActive:home+"/index.php/QnuiRings/QnuiZhekouLimit/get_items_in_active",
   removeLimitActive:home+"/index.php/QnuiRings/QnuiZhekouLimit/remove_active",
   removeLimitInActive:home+"/index.php/QnuiRings/QnuiZhekouLimit/remove_detial",
   editLimitItemInActive:home+"/index.php/QnuiRings/QnuiZhekouLimit/edit_limit_item",
   
	/*连环折扣*/ /*标签及任务*/
    applyTag:home+"/index.php/QnuiRings/QnuiRings/apply_tag",
    saveTag:home+"/index.php/QnuiRings/QnuiRings/save_tag_to_database",
    removeTag:home+"/index.php/QnuiRings/QnuiRings/remove_tag",
    editTagTask:home+"/index.php/QnuiRings/QnuiRings/edit_tag_task",
    removeTagTask:home+"/index.php/QnuiRings/QnuiRings/remove_tag_task",
    getTagTask:home+"/index.php/QnuiRings/QnuiRings/get_tag_task",
    getTagLog:home+"/index.php/QnuiRings/QnuiRings/get_tag_log",
    removeUserTagManual:home+"/index.php/QnuiRings/QnuiRings/remove_user_tag_manual",
    stopUserTagTask:home+"/index.php/QnuiRings/QnuiRings/stop_user_tag_auto_task",
    addUserTagManual:home+"/index.php/QnuiRings/QnuiRings/add_user_tag_manual",
    addUserTagTask:home+"/index.php/QnuiRings/QnuiRings/add_user_tag_auto_task",
    getTagTaskItems:home+"/index.php/QnuiRings/QnuiRings/get_tag_task_items",
    getTagTaskQrcode:home+"/index.php/QnuiRings/QnuiRings/get_tag_task?task_type=qrcode&fields=task_id,countdown,tag_name&data_format=form_data",
	
	/*折扣操作*/
    getRingActiveList:home+"/index.php/QnuiRings/QnuiRingsZhekou/get_active_list", //读取折扣
    getItemsInRingActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/get_items_in_active",
    getLimitInActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/get_limit_in_active",
	//removeLimitInActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/remove_limit_in_active",
    
	// 活动创建
	createTaskShopActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/create_shop_active", //创建全店折扣
    createTaskItemActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/create_item_active",
    createTaskLimitActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/create_limit_active",
	saveTaskActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/add_active_to_database", //保存折扣到数据库
	// 活动修改
    editRingItemActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/edit_item_active",
    editRingLimitActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/edit_limit_active",
    editRingShopActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/edit_shop_active",
    saveRingActiveToDatabase:home+"/index.php/QnuiRings/QnuiRingsZhekou/save_active_in_database",
	// 活动删除
	removeShopActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/remove_shop_active", //删除全店折扣
    //removeLimitActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/remove_limit_active", //删除限购折扣
    removeItemActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/remove_item_active", //删除单品折扣
    removeActiveInDatabase:home+"/index.php/QnuiRings/QnuiRingsZhekou/remove_active_in_database", //删除数据库中的折扣
	//详情创建
	addItemsToRingActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/add_items_to_active",
    addLimitToRingActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/add_limit_to_active",
    saveRingItemToDatabase:home+"/index.php/QnuiRings/QnuiRingsZhekou/save_items_to_database",
	// 详情修改
	editItemInRingActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/edit_item_in_active",
    editLimitInRingActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/edit_limit_in_active",
	updateItemsInRingDatabase:home+"/index.php/QnuiRings/QnuiRingsZhekou/update_items_in_database",
	// 详情删除
    removeItemsInRingActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/remove_items_in_active",
    removeLimitInRingActive:home+"/index.php/QnuiRings/QnuiRingsZhekou/remove_limit_in_active",
    removeItemsInRingDatabase:home+"/index.php/QnuiRings/QnuiRingsZhekou/remove_items_in_database",

	//计算折扣，避免js的除法bug
	math:home+"/index.php/QnuiRings/Math",
	
	//发送消息等待删除标签
	sendUserTagMsg:home+"/services/stomp/", //http://llxl.hz.taeapp.com/stomp/?sid=116841492&tag_id=26050043&buyer_nick=kekydream&add_log_id=400336&timeout=5000&quere=gudiVipService
	
	//二维码倒计时折扣
	addQqTagTask:home+"/index.php/QnuiRings/qrtag/Index/save_tag_to_database",
	
	//手机促销页面
	getPageModels:home+"/index.php/QnuiRings/PageModel/get_models",
	buyPageModels:home+"/index.php/QnuiRings/PageModel/buy_model",
	getShopModels:home+"/index.php/QnuiRings/PageModel/get_shop_models",
	checkBuyModel:home+"/index.php/QnuiRings/PageModel/check_buy_model",
	createPage:home+"/index.php/QnuiRings/Page/create_page",
	getComponents:home+"/index.php/QnuiRings/Page/get_page_components",
	getPages:home+"/index.php/QnuiRings/Page/get_pages",
	removePage:home+"/index.php/QnuiRings/Page/remove_page",
	savePageCompData:home+"/index.php/QnuiRings/PageComponent/save",
	deletePageComp:home+"/index.php/QnuiRings/PageComponent/delete",
	addPageComp:home+"/index.php/QnuiRings/PageComponent/add",
	publishPage:home+"/index.php/QnuiRings/Page/publish_page",
	unPublishPage:home+"/index.php/QnuiRings/Page/un_publish_page",
	getPagePubError:home+"/index.php/QnuiRings/Page/get_page_pub_error",
	editPageTitle:home+"/index.php/QnuiRings/Page/edit_page_title",
	saveAsModel:home+"/index.php/QnuiRings/PageAdmin/save_as_model",
	
	//图片处理接口
	getImages:home+"/index.php/QnuiRings/Image/get_images",
	getImageCatgory:home+"/index.php/QnuiRings/Image/get_image_catgory",
	getItemsOnsale:home+"/index.php/QnuiRings/Image/get_items_onsale",
	getSellerCats:home+"/index.php/QnuiRings/Image/get_seller_cats",
	
	//获取行政区划
	getAreas:home+"/index.php/Service/Area",
	//获取所有店铺等级
	getShopLevels:home+"/index.php/Service/Shoplevels",
	
	//VIP资源
	getVipResource:home+"/index.php/QnuiRings/VipResource/get_resource_list",
	addVipResource:home+"/index.php/QnuiRings/VipResource/add_resource",
	removeVipResource:home+"/index.php/QnuiRings/VipResource/remove_resource",
	getPayUrl:home+"/index.php/QnuiRings/VipResource/get_pay_url",
	getVipOrders:home+"/index.php/QnuiRings/VipResource/get_orders",
	confirmOrder:home+"/index.php/QnuiRings/VipResource/confirm_order",
	confirmOrderApply:home+"/index.php/QnuiRings/VipResource/confirm_order_apply"
  },
  //daily环境,可重写base定义的接口
  development:{
    //
  },
  //线上环境
  production:{
    //这里填入线上的host
    _HOST:"//lbs.taobao.com"
  }
}